package ru.ifmo.ipimenov.ewf_svn.standalone.repository;

import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.SVNException;

/**
 * @author: Ilya Pimenov
 * Scartel Starlab company
 */
public class SvnUrlProvider {
    /**
     * Logger for all purposes
     */
    private static Log log = LogFactory.getLog(SvnUrlProvider.class);

    public static SVNURL getUrl(String filename){
        String urlString =  String.format("https://ilya.pimenov:n7s9m9d3@ewf.googlecode.com:443/svn/trunk/data/4test/%s", filename);
        SVNURL url = null;
        try {
            url = SVNURL.parseURIEncoded(urlString);
        } catch (SVNException e) {
            log.error("Error happend while parsing the url string " + urlString);
        }
        return url;
    }

}
